# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeaturestoreOnlineServingConfigScaling do
  @moduledoc """
  Online serving scaling configuration. If min_node_count and max_node_count are set to the same value, the cluster will be configured with the fixed number of node (no auto-scaling).

  ## Attributes

  *   `cpuUtilizationTarget` (*type:* `integer()`, *default:* `nil`) - Optional. The cpu utilization that the Autoscaler should be trying to achieve. This number is on a scale from 0 (no utilization) to 100 (total utilization), and is limited between 10 and 80. When a cluster's CPU utilization exceeds the target that you have set, Bigtable immediately adds nodes to the cluster. When CPU utilization is substantially lower than the target, Bigtable removes nodes. If not set or set to 0, default to 50.
  *   `maxNodeCount` (*type:* `integer()`, *default:* `nil`) - The maximum number of nodes to scale up to. Must be greater than min_node_count, and less than or equal to 10 times of 'min_node_count'.
  *   `minNodeCount` (*type:* `integer()`, *default:* `nil`) - Required. The minimum number of nodes to scale down to. Must be greater than or equal to 1.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :cpuUtilizationTarget => integer() | nil,
          :maxNodeCount => integer() | nil,
          :minNodeCount => integer() | nil
        }

  field(:cpuUtilizationTarget)
  field(:maxNodeCount)
  field(:minNodeCount)
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeaturestoreOnlineServingConfigScaling do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeaturestoreOnlineServingConfigScaling.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeaturestoreOnlineServingConfigScaling do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
